#ifndef __ft6336_H__
#define __ft6336_H__
#include "main.h"


#if 1 
  #define ft6336_DEBUG(format, args...) printf("[ft6336]-");printf(format, ## args );
#else
  #define ft6336_DEBUG(format, args...) ;
#endif

#define IIC_ADDR_FT6336 0x38

#define FT6636_CMD_WR 0x38
#define FT6636_CMD_RD 0x38+1


#define FT6336_ADDR_DEVICE_MODE 	0x00
#define FT6336_ADDR_TD_STATUS 		0x02
#define FT6336_ADDR_TOUCH1_EVENT 	0x03
#define FT6336_ADDR_TOUCH1_ID 		0x05
#define FT6336_ADDR_TOUCH1_X 		  0x03
#define FT6336_ADDR_TOUCH1_Y 		  0x05

#define FT6336_ADDR_TOUCH2_EVENT 	0x09
#define FT6336_ADDR_TOUCH2_ID 		0x0B
#define FT6336_ADDR_TOUCH2_X 		  0x09
#define FT6336_ADDR_TOUCH2_Y 		  0x0B

#define FT6336_ADDR_FIRMARE_ID 		0xA6

esp_err_t ft6336_init(void);
void  ft6336_test_task(void *pvParameter);



uint8_t FT6336_read_firmware_id(void);
uint8_t FT6336_read_device_mode(void);
uint8_t FT6336_read_td_status(void);
uint16_t FT6336_read_touch1_x(void);
uint16_t FT6336_read_touch1_y(void);
uint8_t FT6336_read_touch1_event(void);
uint8_t FT6336_read_touch1_id(void);

uint8_t FT6336_read_touch2_event(void);
uint8_t FT6336_read_touch2_id(void);
uint16_t FT6336_read_touch2_x(void);
uint16_t FT6336_read_touch2_y(void);

#endif